1. Technical Field
This invention generally relates to computer programming and more specifically relates to a mechanism and method for debugging a computer program.
2. Background Art
The development of the EDVAC computer system of 1948 is often cited as the beginning of the computer era. Since that time, computer systems have evolved into extremely sophisticated devices, and computer systems may be found in many different settings. Computer systems typically include a combination of hardware, such as semiconductors and circuit boards, and software, also known as computer programs. As advances in semiconductor processing and computer architecture push the performance of the computer hardware higher, more sophisticated computer software has evolved to take advantage of the higher performance of the hardware, resulting in computer systems today that are much more powerful than just a few years ago.
As the sophistication and complexity of computer software increase, the more difficult the software is to debug. Debugging is the process of finding problems, or bugs, during the development of a computer program. One way of debugging a computer program is to configure a "watch function" for a variable in the computer program. Borland, a well-known software company, defines one type of watch function that returns the value for a specified variable to display to a user at any stop point. A watch in this context will simply display to the user the variable value each time the program is stopped. Thus, if a programmer is executing one instruction at a time to single-step through the execution of a computer program, the watch function makes the value of the watched variable available to the programmer when the execution is stopped after each instruction.
A different watch finction is also known in the art that allows a user to specify a watched variable, and any change to the variable will cause the execution of the computer program to halt. However, it is not very useful to have the program halt on each and every change to a variable when a variable may be legally changed thousands or millions of times. Trying to isolate a single change due to a bug from a vast number of expected changes is nearly impossible using this prior art watch. Furthermore, these prior art watch functions cannot distinguish between different threads in a multi-process environment.
Many modern computer systems provide a multi-process environment, which allows the computer system to execute multiple processes in parallel. One specific type of computer system that is capable of executing multiple processes is known as a multi-threaded computer system. In a multi-threaded computer system, multiple threads of control are available to the operating system. The operating system assigns different threads to different processes. Modern debugging tools generally do not have a way to distinguish operations on variables by a particular thread from operations on those variables by a different thread.
Without a mechanism for distinguishing operations on a variables by one thread from another during the debugging of a computer program, certain bugs will remain very difficult to detect, resulting in the release of computer software to the public that contains bugs. Buggy software can cost software developers millions of dollars to correct, and can dilute the goodwill of the company in the eyes of the purchaser.